package org.zeroes.Components;

import java.util.ArrayList;
import java.util.List;
import com.zeroes.cons.*;
import org.zeroes.Events.ZSPair;

public class ZSLUParameters {

	private List<ZSPair<String,ZSSingle<?>>> pl;
	private ZSSingle<?> r=null;

public ZSLUParameters(){
	
	pl= new ArrayList<ZSPair<String,ZSSingle<?>>>();
}

public void Add(String def, ZSSingle<?> val){
	
	//String[] items = def.split("\\.");
	pl.add(new ZSPair<String,ZSSingle<?>>(def,val));
	
}

public void AddZSSpriteParam(String def, ZSSprite spr){
	
	//String[] items = def.split("\\.");
	ZSSingle<ZSSprite> sp = new ZSSingle<ZSSprite> (spr);
	pl.add(new ZSPair<String,ZSSingle<?>>(def,sp));
	
}

public ZSSprite getZSSpriteParamAtIndex(int idx){
	
	return (ZSSprite)pl.get(idx).getSecond().getFirst();
}


public ZSSingle<?> getParamAtIndex(int idx){
	
	return pl.get(idx).getSecond();
}

public String getParamDefAtIndex(int idx){
	
	return pl.get(idx).getFirst();
}

public void Result(ZSSingle<?> res){
	
	this.r=res;
}

public ZSSingle<?> getResult(){
	
	return this.r;
}

public void StringResult(String res){
	if (res!=null)
	this.r=new ZSSingle<String>(res);
}

public String getStringResult(){
	
	return (String)this.r.getFirst();
}

public void IntResult(int res){
	
	this.r=new ZSSingle<Integer>(res);
}

public int getIntResult(){
	
	return (Integer)this.r.getFirst();
}

public int getParamsCount(){
	
	return this.pl.size();
}

}
